<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><%@page
	language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="webctx" value="${pageContext.request.contextPath}"/>
<html>
<head>
<title>基站设备</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="GENERATOR"
	content="Rational® Application Developer™ for WebSphere® Software">
<link rel="stylesheet" href="<%=request.getContextPath() %>/js/ext/resources/css/ext-all.css"
	type="text/css">
<link rel="stylesheet" href="${webctx}/js/ext/resources/css/xtheme-gray.css" type="text/css">
<script language="JavaScript" src="<%=request.getContextPath() %>/js/ext/adapter/ext/ext-base.js"></script>
<script language="JavaScript" src="<%=request.getContextPath() %>/js/ext/js/ext-all.js"></script>
<script language="JavaScript" src="<%=request.getContextPath() %>/js/ext/resources/locale/ext-lang-zh_CN.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/extInterceptor.js"></script>
<link rel="stylesheet" href="<%=request.getContextPath() %>/images/dcfs/dcfs.css" type="text/css">
<script type="text/javascript" src="http://api.map.baidu.com/api?v=1.3"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/convertor.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery-plugin/jquery.fileDownload.js"></script>
	<script type="text/javascript">
		Ext.USE_NATIVE_JSON = true;
		window.JSON = {
			"stringify":Ext.util.JSON.doEncode,
			"parse":function(json){
				var str = json;
				var spos = str.indexOf("<audio");
				if(spos != -1){
					str = str.substr(0,spos);
				}
				return eval("("+str+")");
			},
			"toString":function(){
				return '[object JSON]';
			}
		};
	</script>
<script type="text/javascript">

	Ext.form.Field.prototype.msgTarget

Ext.QuickTips.init();
Ext.form.Field.prototype.msgTarget='side';

var sm = new Ext.grid.CheckboxSelectionModel();
var sm2 = new Ext.grid.CheckboxSelectionModel();
var sm3 = new Ext.grid.CheckboxSelectionModel();
var MyViewport = Ext.extend(Ext.Viewport, {
	xtype: "viewport", 
	layout: 'fit',
	
	initComponent: function () {
		this.items = {
		   xtype:"grid",	
	       title:"基站设备信息",
	       id:'jzsb_grid',
	       bodyBorder:true,
           loadMask:true,
           stripeRows:true,
           trackMouseOver: true,
     	   sm:sm,
           store: {
                  xtype:"jsonstore",
			      url:"${webctx}/jzsb_getDcfsJzSbJbxxListByCond.action",
				  root:"root",
			      totalProperty: 'totalCount',
	              fields: [
	              		{name:"JZ_SB_BH"},{name:"JZ_SB_MC"},{name:"JZ_FSTX_JSFS"},
	              		{name:"JZ_SB_XH"},{name:"JZ_SB_AZWZ"},{name:"JZ_YS_DW"},{name:"JZ_YYS_XX"},{name:"JZ_HP_ZT"},{name:"JZ_JC_DW"},{name:"JZ_BZ"},
	              		{name:"YT_MC"},{name:"YT_BH"},{name:"JZ_SB_QYSJ"},{name:"JZ_SB_WLLX"},
	              		{name:"JZ_BCGL"},{name:"JZ_ZPPZ"},{name:"JZ_XXPD_1"},{ name:"JZ_XXPD_2"},
	              		{name:"JZ_TXZY"},{name:"JZ_FSTX_LX"},{name:"JZ_FSTX_FWJ"},
	              		{name:"JZ_FSTX_XPJ"},{name:"JZ_FSTX_JD"},{name:"JZ_FSTX_WD"},
	              		{name:"JZ_FSTX_JSGD"},{name:"JZ_FSTX_SL"},{name:"JZ_BH"},{name:"JZ_FSTX_JHFS"},
	              		{name:"JZ_MC"},{name:"JZ_DD"},{name:"BD_JD"},{name:"BD_WD"},{name:"JZ_SB_QY"}
	               ]
            },
			columns:[sm,
				
	                  {header:"设备编号",dataIndex:"JZ_SB_BH", sortable: true},
	              	  {header:"设备名称",dataIndex:"JZ_SB_MC"},
	              	  {header:"运营商信息",dataIndex:"JZ_YYS_XX"},
	              	  {header:"基站环评状态",dataIndex:"JZ_HP_ZT"},
	              	  {header:"环评检测单位",dataIndex:"JZ_JC_DW"},
	              	  {header:"环评批复单位",dataIndex:"JZ_YS_DW"},
	              	  {header:"天线架设方式",dataIndex:"JZ_FSTX_JSFS"},
	              	  {header:"典型敏感信息描述",dataIndex:"JZ_BZ",width:350},
	              	  {header:"设备安装地理位置",dataIndex:"JZ_SB_AZWZ",width:350}
			],
			viewConfig:{
				enableRowBody:true,
				getRowClass:function(record,rowIndex,p,ds){
					var cls="white-row";
					if(record.data.id%2==0){
						cls="red-row";
					}else{
						cls="yellow-row";
					}
					return cls;
				}
			},
			tbar:["->",
				{
					xtype:"label",
					text:"敏感点名称："
				},{
					xtype:'textfield',
		            id:"mgd_mc"
				},"-",
				"-",{
					xtype:"label",
					text:"地址:"
				},{
					xtype:'textfield',
		            id:"jd_mc"
				},"-",{
					xtype:"label",
					text:"类型:"
				},{
					xtype:"hidden",
					id:"typeCode",
					name:"typeCode"
				},
				{
					xtype:"combo",
					fieldLabel:"主要用途",
					name:"dcfsJzSbJbxx.ytmc",
					id: "type",
					editable:false,
					triggerAction:'all',
					store:new Ext.data.JsonStore({
						fields:["YT_BH","YT_MC"],
						data: [{"YT_BH":"","YT_MC":"全部"},{"YT_BH":"122","YT_MC":"基站设备类"},{"YT_BH":"112","YT_MC":"短波发射（天线）台"},{"YT_BH":"153","YT_MC":"变电站类"}]
					}),
					mode:'local',
					valueField: 'YT_BH',
					displayField: 'YT_MC',
					value:"",
					selectOnFocus:true,
					listeners:{
						"select":function(){
							Ext.getCmp("typeCode").setValue(Ext.getCmp("type").getValue());
						}
					}
				},"-",
				{
					xtype:"label",
					text:"基站名称："
				},{
				    xtype:'textfield',
		            id:"txt"
				},'-',
				{
				     text:'查询', 
				     iconCls: "icon-search",
						handler:function(){
					 	var fsybh='';
					 	if(Ext.getCmp("mgd_mc").getValue()!=''||Ext.getCmp("jd_mc").getValue()!=''){
						 	var cond={'jcdmc':encodeURIComponent(Ext.getCmp("mgd_mc").getValue()),'dcfsHjjcdJbxx.jcdmc':Ext.getCmp("mgd_mc").getValue(),'hjzljkdz':encodeURIComponent(Ext.getCmp("jd_mc").getValue())}
		                    $.ajax({
								async:false,
								url:"{webctx}/jcd_getDcfsHjjcdJbxxByCond_sb.action",
								method:"POST",
								data:cond,
								success:function(object,bool,response){
									fsybh=response.responseText;
								},
								failure:function(response){
									Ext.Msg.alert("提示","加载失败");
								}
							});
					 	}
						 var typeCode=Ext.getCmp("type").getValue();
	                     Ext.getCmp("jzsb_grid").getStore().load({params:{'dcfsJzSbJbxx.jzsbbh':fsybh,'typeCode':typeCode,'dcfsJzSbJbxx.jzsbmc':Ext.getCmp("txt").getValue(),start:0,limit:30}});
					}
				},{
					text:"添加",
					iconCls: "icon-add",
                        handler: function () {
							Ext.getCmp("Win1").setSize(600,390);
							Ext.getCmp('Win1').show();
							Ext.getCmp("center1").setActiveTab(1);
							Ext.getCmp("center1").setActiveTab(0);
						   	Ext.getCmp('Win1').action='add';
							Ext.getCmp("JZ_SB_BH1").setReadOnly(false);
						   	if(Ext.getCmp('Win1').changeValue!='-1'||Ext.getCmp("jzsbForm1")) {
								Ext.getCmp('Win1').setTitle("添加基站设备信息");
								Ext.getCmp("submit_btn1").setText('添加');
							}
							if(!Ext.getCmp("jzsbForm1")) {
								if(Ext.getCmp('Win1').changeValue == '-1') {
									Ext.getCmp('Win1').removeAll();
								}
								Ext.getCmp('Win1').load({url:'${webctx}/jzsb_getDcfsJzSbJbxxListByCond.action',scripts:true,params:{loaditem:"add"}});
								Ext.getCmp('Win1').changeValue = '1';
							}
                        }
				},{
					text:"excel导入添加",
					iconCls: "icon-add",
					handler: function () {
						Ext.getCmp("excel_win").setSize(350,220);
						Ext.getCmp("excel_win").action="add";
						Ext.getCmp("excel_win").show();
						Ext.getCmp("excel_win").center();
					}
				},{
					text:"修改",
					 iconCls: 'icon-update',
                        handler: function (){
                              if (Ext.getCmp("jzsb_grid").getSelectionModel().getCount() == 1) {
                                    var recordNum = -1;
                                    for (var i = 0; i < Ext.getCmp("jzsb_grid").getStore().getCount(); i++) {
                                        if (Ext.getCmp("jzsb_grid").getSelectionModel().getSelected(0).get("JZ_SB_BH") ==
												Ext.getCmp("jzsb_grid").getStore().getAt(i).get("JZ_SB_BH")) {
                                            recordNum = i;
                                            break;
                                        }
                                    }
                                   
                                    Ext.getCmp("Win").setSize(600,390);
                                    Ext.getCmp('Win').show();
                                    Ext.getCmp("center").setActiveTab(1);
								 	Ext.getCmp("center").setActiveTab(0);
                                    Ext.getCmp('Win').action='update';
                                    Ext.getCmp('Win').recordNum=recordNum;
								 	Ext.getCmp("JZ_SB_BH").setReadOnly(true);
                                    
                                    if(Ext.getCmp('Win').changeValue!='-1'||Ext.getCmp("jzsbForm"))
                                    {
                                        Ext.getCmp('Win').setTitle("基站设备信息");
                                        Ext.getCmp("submit_btn").setText('保存');
                                        Ext.getCmp("jzsbForm").getForm().loadRecord(Ext.getCmp("jzsb_grid").getStore().getAt(recordNum));                               
                                    }

                                    if(!Ext.getCmp("jzsbForm"))
                                    {
                                        if(Ext.getCmp('Win').changeValue == '-1')
                                        {
                                            Ext.getCmp('Win').removeAll();
                                        }
                                        Ext.getCmp('Win').load({url:'JZ_SB_JBXX_Servlet',scripts:true,params:{loaditem:"add"}});
                                        Ext.getCmp('Win').changeValue = '1';
                                    }
                              } else if (Ext.getCmp("jzsb_grid").getSelectionModel().getCount() == 0) {
                                    Ext.Msg.alert("提示", "请最少选择一条记录");
                              } else {
                                    Ext.Msg.alert("提示", "只能选择一条数据进行编辑");
                              }
                       }
				},{
					text: "删除",
	                   iconCls: "icon-delete", 
	                   handler: function () {
	                          if (Ext.getCmp("jzsb_grid").getSelectionModel().getCount() > 0) {
                                    Ext.MessageBox.confirm('提示', '数据删除后不可还原,是否删除?', function (btn) {
                                        if (btn != "no") {
                                            var sbytList = "";
                                            for (var i = 0; i < Ext.getCmp("jzsb_grid").getSelectionModel().getSelections().length; i++) {
                                                sbytList += Ext.getCmp("jzsb_grid").getSelectionModel().getSelections()[i].get("JZ_SB_BH");
                                                if (i < Ext.getCmp("jzsb_grid").getSelectionModel().getSelections().length - 1) {
                                                      sbytList += ",";
                                                 }
                                            }
                                            var extAjax = Ext.Ajax;
                                            Ext.Msg.wait("提示","正在删除",{text:"正在删除数据..."});
                                            extAjax.request({
                                                url:"${webctx}/jzsb_deleteDcfsJzSbJbxxByCond.action",
                                                method: 'POST',
                                                params:{action:"3",'dcfsJzSbJbxx.jzsbbh': sbytList},
                                                callback:function (object, bool, response) {
                                                	Ext.Msg.hide();
                                                    Ext.getCmp("jzsb_grid").getStore().load({ params:{ start: 0, limit: 30} } );
                                                },
                                                failure: function (response) {
                                                    Ext.Msg.alert("提示", "操作出现了异常！");
                                                }
                                            });
                                        }
                                    });
                              } else if (Ext.getCmp("jzsb_grid").getSelectionModel().getCount() == 0) {
								Ext.Msg.alert("提示", "请最少选择一条记录");
                              }        
	                    
	                     
	                              
	                }
				}
			],
			bbar:{
                        xtype:'paging',
                        id:"gridbbar",
                        pageSize: 30,
                        store:new Ext.data.JsonStore({}),                    
                        displayInfo: true,
						params : {
                            start : 'start',
                            limit : 'limit'
						},
                        displayMsg: '显示第 {0} 条到 {1} 条记录，一共 {2} 条',
                        emptyMsg: "没有记录",
                        afterPageText:'共{0}页' 
                    },
			listeners: {
                "afterrender": function () {
						Ext.getCmp("jzsb_grid").getStore().load({params:{MGD:Ext.getCmp("mgd_mc").getValue(),JD_MC:Ext.getCmp("jd_mc").getValue(),txt:Ext.getCmp("txt").getValue(),start:0,limit:30,'typeCode':Ext.getCmp("typeCode").getValue()}});
					   	Ext.getCmp("jzsb_grid").getStore().on("beforeload",function(){
							Ext.apply(this.baseParams, {MGD:Ext.getCmp("mgd_mc").getValue(),JD_MC:Ext.getCmp("jd_mc").getValue(),txt:Ext.getCmp("txt").getValue()});
						});
						Ext.getCmp("gridbbar").bind(Ext.getCmp("jzsb_grid").getStore());
					},
				"rowdblclick":function(g,recordNum,e) {
					Ext.getCmp("jzsbForm").getForm().reset();
                    win.setPosition(200,40);
                    win.show();
                    Ext.getCmp("center").setActiveTab(1);
					Ext.getCmp("center").setActiveTab(0);
					win.setSize(600,395);
                    Ext.getCmp("JZ_SB_BH").setReadOnly(true);
				    Ext.getCmp("JZ_SB_QYSJ").setValue(new Date());
					win.action='update';
					win.setTitle('设备信息');
					Ext.getCmp("submit_btn").setText("修改");
					Ext.getCmp("jzsbForm").getForm().loadRecord(Ext.getCmp("jzsb_grid").getStore().getAt(recordNum));				
                }
			}
		}
		MyViewport.superclass.initComponent.call(this);
	}
});

var TSJL_JBXX_Win = new Ext.Window({
        id: "TSJL_JBXX_Win",
        layout: "fit",
        resizable: false,
        collapsible: false,
        closeAction: "hide",
        action: 'add',
        recordNum: -1,
        changeValue: -1,
        modal: true,
        autoDestroy: true,
        width:300,
        height:180,
        labelWidth:80,
        items:[
        	{
	        	xtype:'form',
	        	id:'dlxx_ggts_form',
	        	defaults:{anchor:'96%',border:false},
	        	bodyStyle:'padding:15px 5px 0px 5px',
	        	items:[
	        		{
		   				xtype: "textfield",
		   				fieldLabel: '&nbsp;&nbsp;&nbsp;投诉人',
		   				id:'TS_R',
		   				name:'dcfsGgtsJbxx.tsr'
		   			},{
		   				xtype: "textfield",
		   				fieldLabel: '投诉地点',
		   				id:'TS_DD',
		   				name:'dcfsGgtsJbxx.tsdd'
		   			},{
		   				xtype: "textfield",
		   				fieldLabel: '联系电话',
		   				id:'TS_LXDH',
		   				name:'dcfsGgtsJbxx.tsrlxdh'
		   			}
	        	]
        	}
        ],
        buttons:[
        	{
        		text:'添加',
        		handler:function(){
        			Ext.getCmp('dlxx_ggts_form').getForm().submit({
        				waitMsg : '正在提交表单数据,请稍候...',
						waitTitle : '正在验证数据...',
        				method:"POST",
        				url:"${webctx}/gisggts_insertDcfsGgtsJbxx.action",
                        params : { 'dcfsJzSbJbxx.jzsbbh':Ext.getCmp("JZ_SB_BH").getValue() },
                        success:function(form,action){
                        	Ext.Msg.hide();
                            TSJL_JBXX_Win.hide();
                        },
                        failure:function(form,action){
                            Ext.Msg.alert("提示","操作出现了异常！");
                        }
        			});
        		}
        	},{
        		text:'关闭',
        		handler:function(){
        			TSJL_JBXX_Win.hide();
        		}
        	}
        ],
        listeners: {
            hide: function (w) {
                Ext.getCmp('dlxx_ggts_form').getForm().reset();
            }
        }
    });

var sm1 = new Ext.grid.CheckboxSelectionModel();
var jbxxItems1=[
   {
	   	xtype:"tabpanel",
	   	id:"center1",
	    activeTab:0,
	    items:[{
	    	layout:"form",
	    	title:"基本信息",
	        defaults:{columnWidth:.5,labelWidth:100,border:false},
	        items:[
	        	{
	        		layout:"form",
	                bodyStyle:'padding:5px 5px 0px 5px',
	                defaultType:"textfield",
	                defaults:{anchor:'92%',border:false},
	                items:[
	                	{
	                        fieldLabel:"设备编号",
	       					name:"dcfsJzSbJbxx.jzsbbh",
	       					id: "JZ_SB_BH1",
	                        tabIndex:1,
	                        style:"color:#808080", 
	                        validator:function(){
	                            if(this.getValue().trim().length==0)
	                            {
	                                return "编号不能为空";
	                            }
	                            else
	                            {
	                                return true;
	                            }
	                        }
	                    },{
	                       
	                        fieldLabel:"设备名称",
	                        name:"dcfsJzSbJbxx.jzsbmc",
	                        id: "JZ_SB_MC1", 
	                        validator:function(){
	                            if(this.getValue().trim().length==0)
	                            {
	                                return "设备名称不能为空";
	                            }
	                            else
	                            {
	                                return true;
	                            }
	                        }
	                    },{
	                    	xtype:"combo",
	                    	fieldLabel:"运营商信息",
	                    	name:"dcfsJzSbJbxx.jzyysxx",
	                    	id:"JZ_YYS_XX1",
	                    	editable:false,
	                    	triggerAction:"all",
	                    	store:new Ext.data.SimpleStore({
								fields:[{name:"JZ_YYS_XX"},{name:"JZ_YYS_XX"}],
								data:[["中国移动","中国移动"],["中国电信","中国电信"],["中国联通","中国联通"]]
	                    	}),
	                    	mode:"local",
	                    	valueField:"JZ_YYS_XX",
	                    	displayField:"JZ_YYS_XX",
	                    	value:"中国移动",
	                    	selectOnFocue:true
	                    },{
	                    	fieldLabel:"基站环评状态",
	                    	name:"dcfsJzSbJbxx.jzhpzt",
	                    	id:"JZ_HP_ZT1",
	                    	value:"环评审核已通过"
	                    },{
	                    	fieldLabel:"环评检测单位",
	                    	name:"dcfsJzSbJbxx.jzjcdw",
	                    	id:"JZ_JC_DW1",
	                    	value:"武汉网绿环境技术咨询有限公司"
	                    },{
	                    	fieldLabel:"环评批复单位",
	                    	name:"dcfsJzSbJbxx.jzysdw",
	                    	id:"JZ_YS_DW1",
	                    	value:"湖北省环境保护厅"
	                    },{
	                         fieldLabel: "设备安装地理位置",
	                         name:"dcfsJzSbJbxx.jzsbazwz",
	                         id: "JZ_SB_AZWZ1"
	                    } ,{
					        xtype:"textarea",
					        name:"dcfsJzSbJbxx.jzbz",
					        anchor:"92%",
					        id:"JZ_BZ1",
					        style:"margin-top:3px",
					        fieldLabel:"典型敏感信息描述",
					        tabIndex:20,
					        height:60
					    },{
			                xtype:"hidden",
			                id:"YT_BH1",
			                name:"dcfsJzSbJbxx.ytbh"
			             }
	                ]
	        	}
	        ]
	    },{
	    	layout:"column",
	    	title:"详细信息",
	        defaults:{columnWidth:.5,labelWidth:100,border:false},
	        items:[
	        	{
	        		layout:"form",
	                bodyStyle:'padding:5px 5px 0px 5px',
	                defaultType:"textfield",
	                defaults:{anchor:'92%',border:false},
	                items:[
	                	{
					         fieldLabel: "基站编号",
	                         name:"dcfsJzSbJbxx.jzbh",
	                          id: "JZ_BH1"      
					    },{
	                         fieldLabel: "基站名称",
	                         name:"dcfsJzSbJbxx.jzmc",
	                         id: "JZ_MC1"
	                    }, {
								xtype:"combo",
								fieldLabel: "设备所属区域",
								name:"dcfsJzSbJbxx.jzsbqy",
								id: "JZ_SB_QY1",
								editable: false,
								triggerAction: 'all',
							 	store: new Ext.data.SimpleStore({
									fields:[{name:"JZ_SB_QY"},{name:"JZ_SB_QY"}],
									data: [
											['江岸区',"江岸区"],
											['桥口区',"桥口区"],
											['汉阳区',"汉阳区"],
											['武昌区',"武昌区"],
											['洪山区',"洪山区"],
											['青山区',"青山区"],
											['东西湖区',"东西湖区"],
											['水果湖区',"水果湖区"],
											['江夏区',"江夏区"],
											['蔡甸区',"蔡甸区"],
											['江汉区',"江汉区"],
											['汉南区',"汉南区"],
											['黄陂区',"黄陂区"],
											['新洲区',"新洲区"],
											['东湖高新区', "东湖高新区"],
											['武汉经济开发区',"武汉经济开发区"]
									]
			                    }),
			                    mode:'local',
			                    valueField:'JZ_SB_QY',
			                    displayField:'JZ_SB_QY',
			                    value:'武昌区',
			                    selectOnFocus:true
	                    },{                        
	                        fieldLabel:"设备型号",
	                        name:"dcfsJzSbJbxx.jzsbxh",
	                        id: "JZ_SB_XH1",
	                        editable: false,
	                        maxLength: 64,
	                        maxLengthText: "长度不能大于64位"
	                    },{
	                        xtype:"combo",
	                        fieldLabel:"主要用途",
	                        name:"dcfsJzSbJbxx.ytmc",
	                        id: "YT_MC1",
	                        editable:false,
		                    triggerAction:'all', 
		                    store:new Ext.data.JsonStore({
								fields:[{name:"YT_BH"},{name:"YT_MC"}],
								root:'root',
								url:"${webctx }/sbyt_getDcfsSbYtJbxxListByCond.action"
		                    }),
		                    mode:'local',
		                    valueField: 'YT_BH',
		                    displayField: 'YT_MC',
		                    value:"基站设备类",
		                    selectOnFocus:true,
		                    listeners:{
		                    	"select":function(){
		                    		Ext.getCmp("YT_BH1").setValue(Ext.getCmp("YT_MC1").getValue());
		                    	}
		                    }
	                    }, {
	                         fieldLabel: "网络类型",
	                         name:"dcfsJzSbJbxx.jzsbwllx",
	                         id: "JZ_SB_WLLX1",
	                         value:"WCDMA"
	                    }, {
	                        xtype:"datefield",
	                        fieldLabel: "启用时间",
	                        name:"dcfsJzSbJbxx.jzsbqysj",
	                        editable: false,
	                        id: "JZ_SB_QYSJ1",
	                        format: 'Y-m-d',
	                        value:new Date()
	                    },{
	                        fieldLabel: "天线增益",
	                        name:"dcfsJzSbJbxx.jztxzy",
	                        id: "JZ_TXZY1",
	                        value:"18"
	                    }, {
					         fieldLabel: "下行频段1(MHz)",
	                         name:"dcfsJzSbJbxx.jzxxpd1",
	                         id: "JZ_XXPD_11"
					    },{
		               
			                fieldLabel: "经度",
			                id:'JZ_FSTX_JD1',
			                name:'dcfsJzSbJbxx.jzfstxjd'
			            },{
	                          fieldLabel: "地点",
	                          name:"dcfsJzSbJbxx.jzdd",
	                          id: "JZ_DD1"
	                    }
	                ]
	        	},{
	        		layout:"form",
	                bodyStyle:'padding:5px 5px 0px 5px',
	                defaultType:"textfield",
	                defaults:{anchor:'92%',border:false},
	                items:[
	                	{
	                        fieldLabel: "天线方位角(度)",
	                       	name:"dcfsJzSbJbxx.jzfstxfwj",
	                       	id: "JZ_FSTX_FWJ1"
	                    }, {
	                        fieldLabel: "天线下倾角(度)",
	                        name:"dcfsJzSbJbxx.jzfstxxpj",
	                        id: "JZ_FSTX_XPJ1"
	                    } , {
                         
	                        fieldLabel: "数量",
	                        name:"dcfsJzSbJbxx.jzfstxsl",
	                        id: "JZ_FSTX_SL1"
	                    },{
	                         xtype:"combo",
	                         fieldLabel: "发射天线类型",
	                         name:"dcfsJzSbJbxx.jzfstxlx",
	                         id:"JZ_FSTX_LX1",                       
	                         editable:false, 
	                         triggerAction:'all', 
	                         store:new Ext.data.JsonStore({
	                            fields:[{name:"TXXS_BH"},{name:"TXXS_MC"}],
	                            root:'root',
	                            url:"${webctx }/txxs_getDcfsSbTxxsJbxxListByCond.action"
	                         }),
	                         mode:'local',
	                         valueField: 'TXXS_BH',
	                         displayField: 'TXXS_MC',
	                         value:"定向",
	                         selectOnFocus:true
	                    }, {
	                        xtype:"combo",
	                       	fieldLabel:"天线极化方式",
	                       	name:"dcfsJzSbJbxx.jzfstxjhfs",
	                       	id: "JZ_FSTX_JHFS1",
	                       	editable: false,
	                        triggerAction:'all', 
		                    store:new Ext.data.JsonStore({
								fields:[{name:"JHFS_BH"},{name:"JHFS_MC"}],
								root:'root',
								url:"${webctx }/txfs_getDcfsSbTxjhfsJbxxListByCond.action"
		                    }),
		                    mode:'local',
		                    valueField: 'JHFS_BH',
		                    displayField: 'JHFS_MC',
		                    value:"双极化",
		                    selectOnFocus:true
	                    },{
	                        fieldLabel: "标称功率(W)",
	                        name:"dcfsJzSbJbxx.jzbcgl",
	                        id: "JZ_BCGL1",
	                        value:"20"
	                      
	                    },{
	                         fieldLabel: "架设高度(m)",
	                         name:"dcfsJzSbJbxx.jzfstxjsgd",
	                         id: "JZ_FSTX_JSGD1"
	                    },{
					        fieldLabel: "载频配置",
	                        name:"dcfsJzSbJbxx.jzzppz",
	                        id: "JZ_ZPPZ1",
	                        value:"S111"
					    }, {
					         fieldLabel: "下行频段2(MHz)",
	                         name:"dcfsJzSbJbxx.jzxxpd2",
	                         id: "JZ_XXPD_21"
					    },{
		              
			                fieldLabel: "纬度",
			                id:'JZ_FSTX_WD1',
			                name:'dcfsJzSbJbxx.jzfstxwd'
			            },{
	                         fieldLabel: "天线架设方式 ",
	                         name:"dcfsJzSbJbxx.jzfstxjsfs",
	                         id: "JZ_FSTX_JSFS1"
	                    },{
			                xtype:'hidden',
			                id:'BD_JD1',
				            name:'dcfsJzSbJbxx.bdjd'
				        },{
			                xtype:'hidden',
			                id:'BD_WD1',
			                name:'dcfsJzSbJbxx.bdwd'
			            },{
			            	xtype:'hidden',
			            	id:"JKXT_MN1",
			            	name:"JKXT_MN1"
			            }
	                ]
	        	}
	        ]
	    }]
   }
];

function exportViewProdToExcel() {
	$.fileDownload("${webctx}/file/file_downloadExcelTemplate.action", {
		httpMethod: "POST"
	});
}

var excel_win=new Ext.Window({
	id:"excel_win",
	title:"excel添加设备",
	width:350,
	heigth:200,
	collapsible:true,
	layout:"fit",
	closeAction:"hide",
	modal:true,
	action:"add",
	items:[
		{
			xtype:'form',
			id:"excel_form",
			boder:false,
			frame:false,
			defaultType:"textfield",
			bodyStyle:"padding:10px 5px 0 13px",
			defaults:{anchor:"93%",border:false},
			fileUpload:true,
			items:[
				{
					xtype:'button',
					text: '下载模板',
					handler: function() {
						exportViewProdToExcel();
					},
					anchor:"15%",
					style:"margin-top:20px"
				},{
					xtype: 'panel',
					html: '先下载模板，然后填入数据上传，所有列都必填',
					style:"margin-top:20px"
				},{
					fieldLabel:"上传文件",
					id:'uploadExcelFile',
					name:'uploadExcelFile',
					inputType:"file",
					labelStyle:"margin-top:20px",
					style:"margin-top:20px"
				}
			],
			buttons:[{
				text:"添加",
				id:"excel_button",
				handler:function(){
					Ext.getCmp("excel_form").getForm().submit({
						waitMsg : '正在提交表单数据,请稍候...',
						waitTitle : '正在验证数据...',
						method:"POST",
						url:"${webctx }/jzsb_insertDcfsJzSbJbxxByExcel.action",
						success:function(a,b){
							var result = b.result;
							Ext.Msg.hide();
							Ext.getCmp("excel_form").getForm().reset();
							Ext.getCmp("excel_win").hide();
							if(result.bitStatus){
								Ext.Msg.alert("提示", result.msg);
							}else{
								Ext.Msg.alert("提示", result.msg);
							}
							Ext.getCmp("jzsb_grid").getStore().load({params:{start:0,limit:30,'typeCode':Ext.getCmp("typeCode").getValue()}});
						},
						failure:function(a,b){
							Ext.Msg.alert("提示","操作出现了异常！");
						}
					});

				}
			},{
				text:"取消",
				id:"button_cancel",
				handler:function(){
					Ext.getCmp("excel_form").getForm().reset();
					Ext.getCmp("excel_win").hide();
				}
			}]
		}
	]
});

//添加
var win1=new Ext.Window({
    id: "Win1",
    title: '添加新设备',
    closable:true,
    layout:'fit',
    oper:'add',
    closeAction:'hide',
    resizable:false,
    autoDestroy:true,
    modal:true,
    width:900,
    height:530,
    action:'add',
    items:[
    	{
    		xtype:"form",
            id:"jzsbForm1",
            layout:"form",
            border:false,
            //fileUpload: true,
            defaults:{border:false,labelWidth:100},
            items:jbxxItems1,
            buttons:[
                {
                    text:"添加",
                    id:"submit_btn1",

                    handler:function(){
                        if(Ext.getCmp("jzsbForm1").getForm().isValid() == true){
                        	if(Ext.getCmp("Win1").action=="add")
                            {
								Ext.getCmp("YT_BH1").setValue(Ext.getCmp("YT_MC1").getValue());
                                Ext.getCmp("jzsbForm1").getForm().submit({
                                   waitMsg : '正在提交表单数据,请稍候...',
           						   waitTitle : '正在验证数据...',
                                   method:"POST",
                                   url:"${webctx }/jzsb_insertDcfsJzSbJbxx.action",
                                   params:{},
                                   success:function(form,Retaction){
                                	   Ext.Msg.hide();
	                                   Ext.getCmp("jzsb_grid").getStore().load({params:{start:0,limit:30,'typeCode':Ext.getCmp("typeCode").getValue()}});
	                                   Ext.getCmp("jzsbForm1").getForm().reset();
                                   },
                                   failure:function(form,Retaction){
                                        Ext.Msg.alert("提示","操作出现了异常！");
                                   }
                                });
                           }
                       }
                     }
                },{
                       text:"取消",
                       handler:function(){
                            Ext.getCmp("Win1").hide();
                            Ext.getCmp("jzsbForm1").getForm().reset();
					   }

                }
            ]
    	}
    ],

    listeners:{
    	'hide':function(){
    		Ext.getCmp("jzsbForm1").getForm().reset();
    	},
    	'afterrender':function(){
    	    Ext.getCmp("YT_MC1").getStore().load({callback:function(){
    	    	Ext.getCmp("JZ_FSTX_LX1").getStore().load({callback:function(){
    	    		Ext.getCmp("JZ_FSTX_JHFS1").getStore().load();
    	    	}});
    	    }});



    	}
    }
});

//修改
var sm1 = new Ext.grid.CheckboxSelectionModel();
var jbxxItems=[
   {
	   	xtype:"tabpanel",
	   	id:"center",
	    activeTab:0,
	    items:[{
	    	layout:"form",
	    	title:"基本信息",
	        defaults:{columnWidth:.5,labelWidth:100,border:false},
	        items:[
	        	{
	        		layout:"form",
	                bodyStyle:'padding:5px 5px 0px 5px',
	                defaultType:"textfield",
	                defaults:{anchor:'92%',border:false},
	                items:[
	                	{
	                        fieldLabel:"设备编号",
	       					name:"dcfsJzSbJbxx.jzsbbh",
	       					id: "JZ_SB_BH",
	                        tabIndex:1,
	                        style:"color:#808080", 
	                        validator:function(){
	                            if(this.getValue().trim().length==0)
	                            {
	                                return "编号不能为空";
	                            }
	                            else
	                            {
	                                return true;
	                            }
	                        }
	                    },{
	                       
	                        fieldLabel:"设备名称",
	                        name:"dcfsJzSbJbxx.jzsbmc",
	                        id: "JZ_SB_MC", 
	                        validator:function(){
	                            if(this.getValue().trim().length==0)
	                            {
	                                return "设备名称不能为空";
	                            }
	                            else
	                            {
	                                return true;
	                            }
	                        }
	                    },{
	                    	xtype:"combo",
	                    	fieldLabel:"运营商信息",
	                    	name:"dcfsJzSbJbxx.jzyysxx",
	                    	id:"JZ_YYS_XX",
	                    	editable:false,
	                    	triggerAction:"all",
	                    	store:new Ext.data.SimpleStore({
	                    		fields:[{name:"JZ_YYS_XX"},{name:"JZ_YYS_XX"}],
								data:[["中国移动","中国移动"],["中国电信","中国电信"],["中国联通","中国联通"]]
	                    	}),
	                    	mode:"local",
	                    	valueField:"JZ_YYS_XX",
	                    	displayField:"JZ_YYS_XX",
	                    	selectOnFocue:true
	                    },{
	                    	fieldLabel:"基站环评状态",
	                    	name:"dcfsJzSbJbxx.jzhpzt",
	                    	id:"JZ_HP_ZT"
	                    },{
	                    	fieldLabel:"环评检测单位",
	                    	name:"dcfsJzSbJbxx.jzjcdw",
	                    	id:"JZ_JC_DW"
	                    },{
	                    	fieldLabel:"环评批复单位",
	                    	name:"dcfsJzSbJbxx.jzysdw",
	                    	id:"JZ_YS_DW"
	                    },{
	                         fieldLabel: "设备安装地理位置",
	                         name:"dcfsJzSbJbxx.jzsbazwz",
	                         id: "JZ_SB_AZWZ"
	                    } ,{
					        xtype:"textarea",
					        name:"dcfsJzSbJbxx.jzbz",
					        anchor:"92%",
					        id:"JZ_BZ",
					        style:"margin-top:3px",
					        fieldLabel:"典型敏感信息描述",
					        tabIndex:20,
					        height:60
					    },{
			                xtype:"hidden",
			                id:"YT_BH",
			                name:"dcfsJzSbJbxx.ytbh"
			             }
	                ]
	        	}
	        ]
	    },{
	    	layout:"column",
	    	title:"详细信息",
	        defaults:{columnWidth:.5,labelWidth:100,border:false},
	        items:[
	        	{
	        		layout:"form",
	                bodyStyle:'padding:5px 5px 0px 5px',
	                defaultType:"textfield",
	                defaults:{anchor:'92%',border:false},
	                items:[
	                	{
					         fieldLabel: "基站编号",
	                         name:"dcfsJzSbJbxx.jzbh",
	                          id: "JZ_BH"      
					    },{
	                         fieldLabel: "基站名称",
	                         name:"dcfsJzSbJbxx.jzmc",
	                         id: "JZ_MC"
	                    }, {
	                    	   xtype:"combo",
			               	   fieldLabel: "设备所属区域",
							   name:"dcfsJzSbJbxx.jzsbqy",
							   id: "JZ_SB_QY",
							   editable: false,
			   					 triggerAction: 'all',
			   					 store: new Ext.data.SimpleStore({
			                     fields:[{name:"JZ_SB_QY"},{name:"JZ_SB_QY"}],
								  data: [
			                            ['江岸区',"江岸区"],
					                   	['桥口区',"桥口区"],
					                    ['汉阳区',"汉阳区"],
					                    ['武昌区',"武昌区"],
					                    ['洪山区',"洪山区"],
					                    ['青山区',"青山区"],
					                    ['东西湖区',"东西湖区"],
					                    ['水果湖区',"水果湖区"],
					                    ['江夏区',"江夏区"],
					                    ['蔡甸区',"蔡甸区"],
					                    ['江汉区',"江汉区"],
					                    ['汉南区',"汉南区"],
					                    ['黄陂区',"黄陂区"],
					                    ['新洲区',"新洲区"],
					                    ['东湖高新区', "东湖高新区"],
							    		['武汉经济开发区',"武汉经济开发区"]
								  ]
			                    }),
			                    mode:'local',
			                    valueField:'JZ_SB_QY',
			                    displayField:'JZ_SB_QY',
			                    selectOnFocus:true
	                    },{                        
	                        fieldLabel:"设备型号",
	                        name:"dcfsJzSbJbxx.jzsbxh",
	                        id: "JZ_SB_XH",
	                        editable: false,
	                        maxLength: 64,
	                        maxLengthText: "长度不能大于64位"
	                    },{
	                        xtype:"combo",
	                        fieldLabel:"主要用途",
	                        name:"dcfsJzSbJbxx.ytmc",
	                        id: "YT_MC",
	                        editable:false,
		                    triggerAction:'all', 
		                    store:new Ext.data.JsonStore({
		                            fields:[{name:"YT_BH"},{name:"YT_MC"}],
		                            root:'root',
		                            url:"${webctx }/sbyt_getDcfsSbYtJbxxListByCond.action"
		                    }),
		                    mode:'local',
		                    valueField: 'YT_BH',
		                    displayField: 'YT_MC',
		                    selectOnFocus:true,
		                    listeners:{
		                    	"select":function(){
		                    		Ext.getCmp("YT_BH").setValue(Ext.getCmp("YT_MC").getValue());
		                    	}
		                    }
	                    }, {
	                         fieldLabel: "网络类型",
	                         name:"dcfsJzSbJbxx.jzsbwllx",
	                         id: "JZ_SB_WLLX"
	                    }, {
	                        xtype:"datefield",
	                        fieldLabel: "启用时间",
	                        name:"dcfsJzSbJbxx.jzsbqysj",
	                        editable: false,
	                        id: "JZ_SB_QYSJ",
	                        format: 'Y-m-d',
	                        value:new Date()
	                    },{
	                        fieldLabel: "天线增益",
	                        name:"dcfsJzSbJbxx.jztxzy",
	                        id: "JZ_TXZY"
	                    }, {
					         fieldLabel: "下行频段1(MHz)",
	                         name:"dcfsJzSbJbxx.jzxxpd1",
	                         id: "JZ_XXPD_1"
					    },{
		               
			                fieldLabel: "经度",
			                id:'JZ_FSTX_JD',
			                name:'dcfsJzSbJbxx.jzfstxjd'
			            },{
	                          fieldLabel: "地点",
	                          name:"dcfsJzSbJbxx.jzdd",
	                          id: "JZ_DD"
	                    }
	                ]
	        	},{
	        		layout:"form",
	                bodyStyle:'padding:5px 5px 0px 5px',
	                defaultType:"textfield",
	                defaults:{anchor:'92%',border:false},
	                items:[
	                	{
	                        fieldLabel: "天线方位角(度)",
	                       	name:"dcfsJzSbJbxx.jzfstxfwj",
	                       	id: "JZ_FSTX_FWJ"
	                    }, {
	                        fieldLabel: "天线下倾角(度)",
	                        name:"dcfsJzSbJbxx.jzfstxxpj",
	                        id: "JZ_FSTX_XPJ"
	                    } , {
	                        fieldLabel: "数量",
	                        name:"dcfsJzSbJbxx.jzfstxsl",
	                        id: "JZ_FSTX_SL"
	                    },{
	                         xtype:"combo",
	                         fieldLabel: "发射天线类型",
	                         name:"dcfsJzSbJbxx.jzfstxlx",
	                         id:"JZ_FSTX_LX",                       
	                         editable:false, 
	                         triggerAction:'all', 
	                         store:new Ext.data.JsonStore({
	                            fields:[{name:"TXXS_BH"},{name:"TXXS_MC"}],
	                            root:'root',
	                            url:"${webctx }/txxs_getDcfsSbTxxsJbxxListByCond.action"
	                         }),
	                         mode:'local',
	                         valueField: 'TXXS_BH',
	                         displayField: 'TXXS_MC',
	                         selectOnFocus:true
	                    }, {
	                        xtype:"combo",
	                       	fieldLabel:"天线极化方式",
	                       	name:"dcfsJzSbJbxx.jzfstxjhfs",
	                       	id: "JZ_FSTX_JHFS",
	                       	editable: false,
	                        triggerAction:'all', 
		                    store:new Ext.data.JsonStore({
								fields:[{name:"JHFS_BH"},{name:"JHFS_MC"}],
								root:'root',
								url:"${webctx }/txfs_getDcfsSbTxjhfsJbxxListByCond.action"
		                    }),
		                    mode:'local',
		                    valueField: 'JHFS_BH',
		                    displayField: 'JHFS_MC',
		                    selectOnFocus:true
	                    },{
	                        fieldLabel: "标称功率(W)",
	                        name:"dcfsJzSbJbxx.jzbcgl",
	                        id: "JZ_BCGL"
	                    },{
	                         fieldLabel: "架设高度(m)",
	                         name:"dcfsJzSbJbxx.jzfstxjsgd",
	                         id: "JZ_FSTX_JSGD"
	                    },{
					        fieldLabel: "载频配置",
	                        name:"dcfsJzSbJbxx.jzzppz",
	                        id: "JZ_ZPPZ"
					    }, {
					         fieldLabel: "下行频段2(MHz)",
	                         name:"dcfsJzSbJbxx.jzxxpd2",
	                         id: "JZ_XXPD_2"
					    },{
			                fieldLabel: "纬度",
			                id:'JZ_FSTX_WD',
			                name:'dcfsJzSbJbxx.jzfstxwd'
			            },{
	                         fieldLabel: "天线架设方式 ",
	                         name:"dcfsJzSbJbxx.jzfstxjsfs",
	                         id: "JZ_FSTX_JSFS"
	                    },{
			                xtype:'hidden',
			                id:'BD_JD',
				            name:'dcfsJzSbJbxx.bdjd'
				        },{
			                xtype:'hidden',
			                id:'BD_WD',
			                name:'dcfsJzSbJbxx.bdwd'
			            },{
			            	xtype:'hidden',
			            	id:"JKXT_MN1",
			            	name:"JKXT_MN1"
			            }
	                ]
	        	}
	        ]
	    },{
	    	xtype:"grid",
	    	title:"监测点信息",
	    	id:"jcd_grid",
	    	bodyBorder:true,
	    	loadMask:true,
	    	height:295,
	    	sm:sm1,
	    	store:{
	    		xtype:"jsonstore",
	    		url:"${webctx}/jcd_getDcfsHjjcdJbxxListByCond.action",
	    		root:"root",
	    		fields:[{name:"JCD_BM"},{name:"JZ_SB_BH2"},{name:"JCD_MC"},{name:"HJZL_JK_DZ"},{name:"HJZL_JK_XZQH"},{name:"JCD_DCQD"},{name:"JCD_GLMD"},
	    				{name:"HJZL_JK_LXR"},{name:"HJZL_JK_LXDH"},{name:"JKXT_MN"},{name:"JCLB_MC"},{name:"JKXT_ZB_JD"},
	    				{name:"JKXT_ZB_WD"},{name:"HJZL_BZ"},{name:"JCD_XDFW"},{name:"JCD_XDJL_SP"},{name:"JCD_XDJL_CZ"}]
	    	},
	    	columns:[
						sm1,
						{header:"监控点编号",dataIndex:"JCD_BM"},
						{header:"设备编号",dataIndex:"JZ_SB_BH2"},
						{header:"监控点名称",dataIndex:"JCD_MC"},
						{header:"地址",dataIndex:"HJZL_JK_DZ"},
						{header:"行政区划",dataIndex:"HJZL_JK_XZQH"},
						{header:"相对方位",dataIndex:"JCD_XDFW"},
						{header:"水平距离(m)",dataIndex:"JCD_XDJL_SP"},
						{header:"垂直距离(m)",dataIndex:"JCD_XDJL_CZ"},
						{header:"电场强度E",dataIndex:"JCD_DCQD"},
						{header:"功率密度",dataIndex:"JCD_GLMD"},
						{header:"联系电话",dataIndex:"HJZL_JK_LXDH"},
						{header:"通讯标识",dataIndex:"JKXT_MN"},
						{header:"监测类别名称",dataIndex:"JCLB_MC"},
						{header:"经度",dataIndex:"JKXT_ZB_JD"},
						{header:"纬度",dataIndex:"JKXT_ZB_WD"},
						{header:"备注",dataIndex:"HJZL_BZ"}
	    			],
	    	tbar:[
		    	"->",
		    	{
		    		text:"添加",
		    		iconCls:"icon-add",
		    		handler:function(){
		    			Ext.getCmp("win_jcd").setSize(600,380);
		    			Ext.getCmp("win_jcd").show();
		    			Ext.getCmp("win_jcd").action="add";
		    			Ext.getCmp("win_jcd").center();
		    			Ext.getCmp("JCD_BM").setReadOnly(false);
		    			if(Ext.getCmp("win_jcd").changeValue!="-1"||Ext.getCmp("jcd_form")){
		    				Ext.getCmp("win_jcd").setTitle("添加监测点信息");
		    				Ext.getCmp("HJZL_JK_XZQH").setValue(Ext.getCmp("JZ_SB_QY").getValue());
		    				Ext.getCmp("submit_button").setText("添加");
		    			}
		    			if(!Ext.getCmp("jcd_form")){
		    				if(Ext.getCmp("win_jcd").changeValue=="-1"){
		    					Ext.getCmp("win_jcd").removeAll();
		    				}
		    				Ext.getCmp("win_jcd").load({
								url:"${webctx}/jcd_getDcfsHjjcdJbxxListByCond.action",scripts:true,
								params: {
									loaditem:"add",
									'dcfsHjjcdJbxx.jzsbbh':Ext.getCmp("JZ_SB_BH").getValue()
								}
							});
		    				Ext.getCmp("win_jcd").changeValue="1";
		    			}
		    		}
		    	},"-",{
		    		text:"修改",
		    		iconCls:"icon-update",
		    		handler:function(){
		    			if(Ext.getCmp("jcd_grid").getSelectionModel().getCount()==1){
		    				var recordNum=-1;
		    				for(var i=0;i<Ext.getCmp("jcd_grid").getStore().getCount();i++){
		    					if(Ext.getCmp("jcd_grid").getSelectionModel().getSelected(0).get("JCD_BM")==
										Ext.getCmp("jcd_grid").getStore().getAt(i).get("JCD_BM")){
		    						recordNum=i;
		    						Ext.getCmp("JCD_BM2").setValue(Ext.getCmp("jcd_grid").getSelectionModel().getSelected(0).get("JCD_BM"));
		    						break;
		    					}
		    				}
		    				Ext.getCmp("win_jcd").setSize(600,380);
		    				Ext.getCmp("win_jcd").show();
		    				Ext.getCmp("win_jcd").action="update";
		    				Ext.getCmp("win_jcd").recordNum=recordNum;
		    				Ext.getCmp("win_jcd").center();
		    				if(Ext.getCmp("win_jcd").changeValue!="-1"||Ext.getCmp("jcd_form")){
		    					Ext.getCmp("win_jcd").setTitle("监测点信息");
		    					Ext.getCmp("submit_button").setText("保存");
		    					Ext.getCmp("jcd_form").getForm().loadRecord(Ext.getCmp("jcd_grid").getStore().getAt(recordNum));
		    				}
		    				if(!Ext.getCmp("jcd_form")){
		    					if(Ext.getCmp("win_jcd").changeValue=="-1"){
		    						Ext.getCmp("win_jcd").removeAll();
		    					}
		    					Ext.getCmp("win_jcd").load({
		    						url:"${webctx}/jcd_getDcfsHjjcdJbxxListByCond.action",
									scripts:true,
									params: {loaditem:"add",'dcfsHjjcdJbxx.jzsbbh':Ext.getCmp("JZ_SB_BH").getValue()}
		    					});
		    					Ext.getCmp("win_jcd").changeValue="1";
		    				}
		    			}else if(Ext.getCmp("jcd_grid").getSelectionModel().getCount()==0){
		    				Ext.Msg.alert("提示","请最少选择一条记录");
		    			}else{
		    				Ext.Msg.alert("提示","只能选择一条数据 进行编辑");
		    			}
		    		}
		    	},"-",{
		    		text:"删除",
		    		iconCls:"icon-delete",
		    		handler:function(){
		    			if(Ext.getCmp("jcd_grid").getSelectionModel().getCount()>0){
		    				Ext.MessageBox.confirm("提示","数据删除后不可还原，是否删除？",function(btn){
		    					if(btn!="no"){
								var sbbhList="";
		    						for(var i=0;i<Ext.getCmp("jcd_grid").getSelectionModel().getSelections().length;i++){
		    							sbbhList+=Ext.getCmp("jcd_grid").getSelectionModel().getSelections()[i].get("JCD_BM");
		    							if(i<Ext.getCmp("jcd_grid").getSelectionModel().getSelections().length-1){
		    								sbbhList+=",";
		    							}
		    						}
		    						var extAjax=Ext.Ajax;
		    						Ext.Msg.wait("提示","正在删除",{text:"正在删除数据..."});
		    						extAjax.request({
		    							url:"${webctx}/jcd_deleteDcfsHjjcdJbxx.action",
		    							method:"POST",
		    							params:{'dcfsHjjcdJbxx.jcdbm':sbbhList},
		    							callback:function(object,bool,response){
		    								Ext.Msg.hide();
		    								Ext.getCmp("jcd_grid").getStore().load({
		    									params:{'dcfsHjjcdJbxx.jzsbbh':Ext.getCmp("JZ_SB_BH").getValue()}
		    								});
		    							},
		    							failure:function(response){
		    								Ext.Msg.alert("提示","操作出现了异常！");
		    							}
		    						});
		    					}
		    				});
		    			}else if(Ext.getCmp("jcd_grid").getSelectionModel().getCount()==0){
			    			Ext.Msg.alert("提示","请最少选择一条记录");
			    		}
		    		}
		    	}
		    ],
		    
		    listeners:{
		    	"show":function(){
		    		Ext.getCmp("jcd_grid").getStore().load({
		    			params:{'dcfsHjjcdJbxx.jzsbbh':Ext.getCmp("JZ_SB_BH").getValue(), 'typeCode':Ext.getCmp("typeCode").getValue()}
		    		});
		   		 },
		   		 "hide":function(){
		   		 	Ext.getCmp("jcd_grid").getStore().removeAll();
		   		 }
		    }
	    },{
	    	xtype:"grid",
	    	title:"基站文档 ",
	    	id:"jz_wdxx",
	    	bodyBorder:true,
	    	loadMask:true,
	    	height:295,
	    	sm:sm2,
	    	store:{
	    		xtype:"jsonstore",
	    		url:"${webctx}/doc_getDcfsDocmentListByCond.action",
	    		root:"wd",
	    		fields:[{name:"docid"},{name:"jzsbbh"},{name:"docname"},{name:"doctime"},{name:"docauthor"},{name:"doctype"},{name:"docurl"}]
	    	},
	    	columns:[
	    		sm2,
	    		{header:"文档编码",dataIndex:"docid"},
	    		{header:"基站设备编号",dataIndex:"jzsbbh"},
	    		{header:"文档名称",dataIndex:"docname"},
	    		{header:"上传时间",dataIndex:"doctime"},
	    		{header:"上传作者",dataIndex:"docauthor"},
	    		{header:"文档类型",dataIndex:"doctype"},
	    		{header:"文档路径",dataIndex:"docurl",
	    			renderer:function(value,g,record){
                              return '<a href="${webctx}/doc_downLoadFile.action?docUrl='+
									  record.get("docurl")+'&FiledataFileName='+record.get("docname") +
									  '&FiledataContentType='+record.get("doctype")+'" >下载</a>';
                      }
	    		}
	    	],
	    	tbar:["->",{
	    		text:"添加",
	    		iconCls:"icon-add",
	    		handler:function(){
	    			Ext.getCmp("win_document").setSize(350,220);
	    			Ext.getCmp("win_document").action="add";
	    			Ext.getCmp("win_document").show();
	    			Ext.getCmp("win_document").center();
	    			if(Ext.getCmp("win_document").changeValue!="-1"||Ext.getCmp("document_form")){
		    			Ext.getCmp("win_document").setTitle("添加监测点信息");
		    			Ext.getCmp("button_mgd").setText("添加");
		    		}
	    			if(!Ext.getCmp("document_form")){
	    				if(Ext.getCmp("win_document").changeValue=="-1"){
	    					Ext.getCmp("win_document").removeAll();
	    				}
	    				Ext.getCmp("win_document").load();
	    				Ext.getCmp("win_document").changeValue="1";
	    			}
	    		}
	    	},{
	    		text:"删除",
	    		iconCls:"icon-delete",
	    		handler:function(){
	    				if(Ext.getCmp("jz_wdxx").getSelectionModel().getCount()>0){
	    					Ext.MessageBox.confirm("提示","数据删除后不可还原，是否删除",function(btn){
	    						if(btn!="no"){
	    							var docIdList="";
	    							var docUrlList="";
		    						for(var dId=0;dId<Ext.getCmp("jz_wdxx").getSelectionModel().getSelections().length;dId++){
		    							docIdList+=Ext.getCmp("jz_wdxx").getSelectionModel().getSelections()[dId].get("docid");
		    							docUrlList+=Ext.getCmp("jz_wdxx").getSelectionModel().getSelections()[dId].get("docurl");
		    							if(dId<Ext.getCmp("jz_wdxx").getSelectionModel().getSelections().length-1){
		    								docIdList+=",";
		    								docUrlList+=",";
		    							}
		    						}
	    							var extAjax=Ext.Ajax;
	    							Ext.Msg.wait("提示","正在删除",{text:"正在删除数据..."});
	    							extAjax.request({
	    								url:"${webctx}/doc_deleteDcfsDocmentByCond.action",
	    								method:"POST",
	    								params:{action:"2",'dcfsDocument.docid':docIdList,'dcfsDocument.docurl':docUrlList},
	    								callback:function(object,bool,response){
	    									Ext.Msg.hide();
	    									Ext.getCmp("jz_wdxx").getStore().load({
	    										params:{'dcfsDocument.jzsbbh':Ext.getCmp("JZ_SB_BH").getValue()}
	    									});
	    								},
	    								failure:function(response){
	    									Ext.Msg.alert("提示","操作出现了异常！");
	    								}
	    							});
	    						}else if(Ext.getCmp("jz_wdxx").getSelectionModel().getCount()==0){
	    							Ext.Msg.alert("提示","请最少选择一条记录");
	    						}
	    					});
	    				}
	    			}
	    	}],
	    	listeners:{
		    	"show":function(){
		    		Ext.getCmp("jz_wdxx").getStore().load({params:{'dcfsDocument.jzsbbh':Ext.getCmp("JZ_SB_BH").getValue()}});
		   		 },
		   		 "hide":function(){
		   		 	Ext.getCmp("jz_wdxx").getStore().removeAll();
		   		 }
		    }
	    },{
	    	xtype:"grid",
	    	title:"监测结果",
	    	id:"jcjg_grid",
	    	bodyBorder:true,
	    	loadMask:true,
	    	height:295,
	    	sm:sm3,
	    	store:{
	    		xtype:"jsonstore",
	    		url:"${webctx}/jcjg_getDcfsJcjgListByCond.action",
	    		root:"jcjg",
	    		fields:[{name:"JZ_ID"},{name:"JZ_BH"},{name:"JZ_MC"},{name:"JZ_FW"},{name:"JZ_TXZXJL"},
	    				{name:"JZ_TXSPJL"},{name:"JZ_DCQD"},{name:"GL_MD"}]
	    	},
	    	columns:[
	    		sm3,
	    		{header:"编号",dataIndex:"JZ_ID"},
	    		{header:"基站设备编号",dataIndex:"JZ_BH"},
	    		{header:"监测设备名称",dataIndex:"JZ_MC"},
	    		{header:"方位",dataIndex:"JZ_FW"},
	    		{header:"与天线垂直距离",dataIndex:"JZ_TXZXJL"},
	    		{header:"与天线水平距离（m）",dataIndex:"JZ_TXSPJL"},
	    		{header:"电场强度（V/m）",dataIndex:"JZ_DCQD"},
	    		{header:"功率密度Pd（uW/cm2）",dataIndex:"GL_MD"}
	    	],
	    	tbar:["->",{ 
	    		text:"添加",
	    		iconCls:"icon-add",
	    		handler:function(){
	    			Ext.getCmp("win_jcjg").setSize(350,220);
	    			Ext.getCmp("win_jcjg").action="add";
	    			Ext.getCmp("win_jcjg").show();
	    			Ext.getCmp("win_jcjg").center();
	    			if(Ext.getCmp("win_jcjg").changeValue!="-1"||Ext.getCmp("jcjg_form")){
		    			Ext.getCmp("win_jcjg").setTitle("监测结果信息");
		    			Ext.getCmp("button_jcjg").setText("添加");
		    		}
	    			if(!Ext.getCmp("jcjg_form")){
	    				if(Ext.getCmp("win_jcjg").changeValue=="-1"){
	    					Ext.getCmp("win_jcjg").removeAll();
	    				}
	    				Ext.getCmp("win_jcjg").load();
	    				Ext.getCmp("win_jcjg").changeValue="1";
	    			}
	    		}
	    	},{ 
	    		text:"修改",
	    		iconCls:"icon-update",
	    		handler:function(){
	    			if(Ext.getCmp("jcjg_grid").getSelectionModel().getCount()==1){
	    				var recordNum=-1;
	    				for(var i=0;i<Ext.getCmp("jcjg_grid").getStore().getCount();i++){
	    					if(Ext.getCmp("jcjg_grid").getSelectionModel().getSelected(0).get("JZ_ID")==
									Ext.getCmp("jcjg_grid").getStore().getAt(i).get("JZ_ID")){
	    						recordNum=i;
	    						break;
	    					}
	    				}
	    				Ext.getCmp("win_jcjg").setSize(350,220);
	    				Ext.getCmp("win_jcjg").show();
	    				Ext.getCmp("win_jcjg").action="update";
	    				Ext.getCmp("win_jcjg").recordNum=recordNum;
	    				Ext.getCmp("win_jcjg").center();
	    				Ext.getCmp("JZ_BH").setReadOnly(true);
	    				Ext.getCmp("JZ_MC").setReadOnly(true);
	    				if(Ext.getCmp("win_jcjg").changeValue!="-1"||Ext.getCmp("jcjg_form")){
	    					Ext.getCmp("win_jcjg").setTitle("监测结果信息");
	    					Ext.getCmp("button_jcjg").setText("保存");
	    					Ext.getCmp("jcjg_form").getForm().loadRecord(Ext.getCmp("jcjg_grid").getStore().getAt(recordNum));
	    				}
	    				if(!Ext.getCmp("jcjg_form")){
	    					if(Ext.getCmp("win_jcjg").changeValue=="-1"){
	    						Ext.getCmp("win_jcjg").removeAll();
	    					}                            
  	    					Ext.getCmp("win_jcjg").load({
  	    						url:"${webctx}/jcjg_getDcfsJcjgListByCond.action",
								scripts:true,
								params: {loaditem:"add",'dcfsJcjg.JZ_BH':Ext.getCmp("JZ_BH").getValue()}
  	    					});
	    					Ext.getCmp("win_jcjg").changeValue="1";
  	    				}
	    			}else if(Ext.getCmp("jcjg_grid").getSelectionModel().getCount()==0){
	    				Ext.Msg.alert("提示","请最少选择一条记录");
	    			}else{
	    				Ext.Msg.alert("提示","只能选择一条数据 进行编辑");
	    			}
	    		} 
	    	},{
	    		text:"删除",
	    		iconCls:"icon-delete",
	    		handler:function(){
	    				if(Ext.getCmp("jcjg_grid").getSelectionModel().getCount()>0){
	    					Ext.MessageBox.confirm("提示","数据删除后不可还原，是否删除",function(btn){
	    						if(btn!="no"){
	    							var sbbhList="";
		    						for(var w=0;w<Ext.getCmp("jcjg_grid").getSelectionModel().getSelections().length;w++){
		    							sbbhList+=Ext.getCmp("jcjg_grid").getSelectionModel().getSelections()[w].get("JZ_ID");
		    							if(w<Ext.getCmp("jcjg_grid").getSelectionModel().getSelections().length-1){
		    								sbbhList+=",";
		    							}
		    						}
	    							var extAjax=Ext.Ajax;
	    							Ext.Msg.wait("提示","正在删除",{text:"正在删除数据..."});
		    						extAjax.request({
		    							url:"${webctx}/jcjg_deleteDcfsJcjgByCond.action",
		    							method:"POST",
		    							params:{action:"2",'dcfsJcjg.JZ_ID':sbbhList},
		    							callback:function(object,bool,response){
		    								Ext.Msg.hide();
		    								Ext.getCmp("jcjg_grid").getStore().load({params:{'dcfsJcjg.JZ_BH':Ext.getCmp("JZ_BH").getValue()}});
		    							},
		    							failure:function(response){
		    								Ext.Msg.alert("提示","操作出现了异常！");
		    							}
		    						});
	    						}
	    					});
	    				}else if(Ext.getCmp("jcjg_grid").getSelectionModel().getCount()==0){
			    			Ext.Msg.alert("提示","请最少选择一条记录");
			    		}
	    			} 
	    	}],
			    listeners:{
			    	"show":function(){
			    		Ext.getCmp("jcjg_grid").getStore().load({params:{'dcfsJcjg.JZ_BH':Ext.getCmp("JZ_BH").getValue()}});
			   		 },
			   		 "hide":function(){
			   		 	Ext.getCmp("jcjg_grid").getStore().removeAll();
			   		 }
			    }
	    }
	   ]
   }
]

var win_document=new Ext.Window({
	id:"win_document",
	title:"添加文档信息",
	width:350,
	heigth:200,
	collapsible:true,
	layout:"fit",
	closeAction:"hide",
	modal:true,
	action:"add",
	items:[
		{
			xtype:'form',
			id:"document_form",
			boder:false,
			frame:false,
			defaultType:"textfield",
			bodyStyle:"padding:10px 5px 0 13px",
			defaults:{anchor:"93%",boder:false,blankText:"不能为空"},
			fileUpload:true,
			items:[
				{
					fieldLabel:"文档名称",
					name:"dcfsDocument.docname",
					id:"docname"
				},{
					fieldLabel:"上传文件",
					id:'uploadFile',
					name:'uploadFile',
					inputType:"file",
					width:"200",
					anchor:"93%"
				},{
					xtype:"datefield",
					fieldLabel:"上传时间",
					name:"dcfsDocument.doctime",
					id:"doctime",
					editable:false,
					format:"Y-m-d",
					value:new Date()
				},{
					fieldLabel:"上传作者",
					name:"dcfsDocument.docauthor",
					id:"docauthor"
				},{
					xtype:"combo",
					fieldLabel:"文档类型",
					name:"dcfsDocument.doctype",
					id:"doctype",
						editable: false,
						triggerAction: 'all',
						store: new Ext.data.SimpleStore({
							fields: [{ name: "WD_LX" },{ name: "WD_LX"}],
							data: [
								['图片',"图片"],
								['其他',"其他"]
							]
						}),
						mode: 'local',
						valueField: 'WD_LX',
						displayField: 'WD_LX',
						selectOnFocus: true,
						emptyText: "请选择……"
				},{
					xtype:"hidden",
					name:"dcfsDocument.jzsbbh",
					id:"jzsbbh"
				}
			],
			buttons:[{
				text:"添加",
				id:"document_button",
				handler:function(){
					Ext.getCmp("jzsbbh").setValue(Ext.getCmp("JZ_SB_BH").getValue());
					Ext.getCmp("document_form").getForm().submit({
						waitMsg : '正在提交表单数据,请稍候...',
						waitTitle : '正在验证数据...',
						method:"POST",
						url:"${webctx}/doc_insertDcfsDocmentByCond.action",
						success:function(form,Retaction){
							Ext.Msg.hide();
							Ext.getCmp("jz_wdxx").getStore().load({params:{'dcfsDocument.jzsbbh':Ext.getCmp("JZ_SB_BH").getValue()}});
							Ext.getCmp("document_form").getForm().reset();
							Ext.getCmp("win_document").hide();
						},
						failure:function(form,Retaction){
							Ext.Msg.alert("提示","操作出现了异常!");
						}
					});
				}
			},{
				text:"取消",
				id:"button_cancel",
				handler:function(){
					Ext.getCmp("document_form").getForm().reset();
					Ext.getCmp("win_document").hide();
				}
			}]
		}
	]
});

// 添加监测结果
var win_jcjg=new Ext.Window({
	id:"win_jcjg",
	title:"监测结果信息",
	width:350,
	heigth:200,
	collapsible:true,
	layout:"fit",
	closeAction:"hide",
	modal:true,
	action:"add",
	labelWidth:200,
	items:[
		{
			xtype:'form',
			id:"jcjg_form",
			boder:false,
			frame:false,
			defaultType:"textfield",
			bodyStyle:"padding:10px 5px 0 13px",
			defaults:{anchor:"93%",boder:false,blankText:"不能为空"},
			items:[
				{
					xtype:"hidden",
					name:"dcfsJcjg.JZ_ID",
					id:"JZ_ID"
				},{
					xtype:"hidden",
				    name:"dcfsJcjg.JZ_MC",
				    id: "JZ_MC4"
				},{
					fieldLabel:"基站方位",
					name:"dcfsJcjg.JZ_FW",
					id:"JZ_FW"
				},{
					fieldLabel:"天线直线距离",
					name:"dcfsJcjg.JZ_TXZXJL",
					id:"JZ_TXZXJL"
				},{
					fieldLabel:"与天线水平距离",
					name:"dcfsJcjg.JZ_TXSPJL",
					id:"JZ_TXSPJL"
				},{
					fieldLabel:"电场强度",
					name:"dcfsJcjg.JZ_DCQD",
					id:"JZ_DCQD"
				},{
					fieldLabel:"功率密度",
					name:"dcfsJcjg.GL_MD",
					id:"GL_MD"
				},{
					xtype:"hidden",
					name:"dcfsJcjg.JZ_BH",
					id:"JZ_BH4"
				} 
			],
			buttons:[{
				text:"添加",
				id:"button_jcjg",
				handler:function(){
					if(Ext.getCmp("win_jcjg").action=="add"){
						Ext.getCmp("JZ_BH4").setValue(Ext.getCmp("JZ_BH").getValue());
						Ext.getCmp("JZ_MC4").setValue(Ext.getCmp("JZ_MC").getValue());
						Ext.getCmp("jcjg_form").getForm().submit({
							waitMsg : '正在提交表单数据,请稍候...',
							waitTitle : '正在验证数据...',
							method:"POST",
							url:"${webctx}/jcjg_insertDcfsJcjgByCond.action",
							params:{action:"1"},
							success:function(form,Retaction){
								Ext.Msg.hide();
								Ext.getCmp("jcjg_grid").getStore().load({params:{'dcfsJcjg.JZ_BH':Ext.getCmp("JZ_BH").getValue()}});
								Ext.getCmp("jcjg_form").getForm().reset();
								Ext.getCmp("win_jcjg").hide();
							},
							failure:function(form,Retaction){
								Ext.Msg.alert("提示","操作出现了异常!");
							}
						});
					}
					if(Ext.getCmp("win_jcjg").action=="update"){
						Ext.getCmp("jcjg_form").getForm().submit({
							waitMsg : '正在提交表单数据,请稍候...',
							waitTitle : '正在验证数据...',
							mothod:"POST",
							url:"${webctx}/jcjg_updateDcfsJcjgByCond.action",
							params:{action:"2"},
							success:function(form,Retaction){
								Ext.Msg.hide();
								Ext.getCmp("jcjg_grid").getStore().load({params:{'dcfsJcjg.JZ_BH':Ext.getCmp("JZ_BH").getValue()}});
								Ext.getCmp("jcjg_form").getForm().reset();
								Ext.getCmp("win_jcjg").hide();
							},
							failure:function(form,Retaction){
								Ext.Msg.alert("提示","操作出现了异常!");
							}
						});
					}
				}
			},{
				text:"取消",
				id:"buttonJcjg_cancel",
				handler:function(){
					Ext.getCmp("jcjg_form").getForm().reset();
					Ext.getCmp("win_jcjg").hide();
				}
			}]
		}
	]
});

var win_mgd=new Ext.Window({
	id:"win_mgd",
	title:"添加敏感点信息",
	layout:"fit",
	height:400,
	width:600,
	collapsible: true, 
	layout:'fit',  
	collapsible: false,
	closeAction: "hide",
	modal: true,   
	action:'add',
	items:[{
		xtype:"form",
		border:false,
		id:"mgd_form",
		defaultType:"textfield",
		bodyStyle:"padding:15px 15px 15px 15px",
		defaults:{anchor:"93%",border:false,blankText:"不能为空"},
		fileUpload: true,
		items:[
			{
				fieldLabel:"敏感点编号",
				name:"dcfsMgdJbxx.mgdbh",
				id:"MGD_BH"
			},{
				xtype:"hidden",
				fieldLabel:"辐射源编号",
				name:"dcfsMgdJbxx.mgdfsybh",
				id:"MGD_FSY_BH"
			},{
				fieldLabel:"敏感点名称",
				name:"dcfsMgdJbxx.mgdmc",
				id:"MGD_MC"
			},{
				fieldLabel:"敏感点地址",
				name:"dcfsMgdJbxx.mgddz",
				id:"MGD_DZ"
			},{
				fieldLabel:"敏感点方位",
				name:"dcfsMgdJbxx.mgdfw",
				id:"MGD_FW"
			},{
				fieldLabel:"垂直&nbsp;&nbsp;&nbsp;距离",
				name:"dcfsMgdJbxx.mgdczjl",
				id:"MGD_CZJL"
			},{
				fieldLabel:"联系&nbsp;&nbsp;&nbsp;方式",
				name:"dcfsMgdJbxx.mgdlxfs",
				id:"MGD_LXFS"
			},{
				fieldLabel:"敏感点经度",
				name:"dcfsMgdJbxx.mgdjd",
				id:"MGD_JD"
			},{
				fieldLabel:"敏感点纬度",
				name:"dcfsMgdJbxx.mgdwd",
				id:"MGD_WD"
			},{
				xtype:"textarea",
		        name:"dcfsMgdJbxx.mgdbz",
		        anchor:"93%",
		        id:"MGD_BZ",
		        style:"margin-top:3px",
		        fieldLabel:"备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注",
		        tabIndex:20,
		        height:60
			}
		],
		buttons:[
			{
				text:"添加",
				id:"button_mgd",
				handler:function(){
					if(Ext.getCmp("win_mgd").action=="add"){
						Ext.getCmp("MGD_FSY_BH").setValue(Ext.getCmp("JZ_SB_BH").getValue());
						Ext.getCmp("mgd_form").getForm().submit({
							waitMsg : '正在提交表单数据,请稍候...',
							waitTitle : '正在验证数据...',
							method:"POST",
							url:"${webctx }/mgd_insertDcfsMgdJbxxByCond.action",
							success:function(form,Retaction){
								Ext.Msg.hide();
								Ext.getCmp("mgd_grid").getStore().load({
									params:{'dcfsMgdJbxx.mgdfsybh':Ext.getCmp("JZ_SB_BH").getValue()}
								});
								Ext.getCmp("mgd_form").getForm().reset();
								Ext.getCmp("win_mgd").hide();
							},
							failure:function(form,Retaction){
								Ext.Msg.alert("提示","操作出现了异常！");
							}
						})
					}
				}
			},{
				text:"取消",
				id:"button_cancel",
				handler:function(){
					Ext.getCmp("mgd_form").getForm().reset();
					Ext.getCmp("win_mgd").hide();
				}
			}
		]
	}]
});

// 监测点添加
var win_jcd=new Ext.Window({
	id:"win_jcd",
	title:"添加监测点信息",
	layout:"fit",
	resizable:false,
	collapsible:false,
	closeAction:"hide",
	modal:true,
	autoDestroy:true,
	action:"add",
	items:[{
		xtype:"form",
		id:"jcd_form",
		layout:"form",
		bodyStyle:"padding:5px 5px 0 5px",
		defaults:{border:false,labelWidth:80},
		items:[
			{
				layout:"column",
				defaults:{columnWidth:.5,labelWidth:95,border:false},
				items:[{
					layout:"form",
		            bodyStyle:'padding:5px 5px 0px 5px',
		            defaultType:"textfield",
		            defaults:{anchor:'97%',border:false},
		            items:[{
		            	fieldLabel: "监控点编号",
	                    name:"jcdbm1",
	                    id: "JCD_BM"
		            },{
		            	fieldLabel:"监控点名称",
		            	name:"dcfsHjjcdJbxx.jcdmc",
		            	id:"JCD_MC"
		            },{
		            	fieldLabel:"相对方位",
		            	name:"dcfsHjjcdJbxx.jcdxdfw",
		            	id:"JCD_XDFW"
		            },{
		            	fieldLabel:"水平距离(m)",
		            	name:"dcfsHjjcdJbxx.jcdxdjlsp",
		            	id:"JCD_XDJL_SP"
		            },{
		            	fieldLabel:"功率密度",
		            	name:"dcfsHjjcdJbxx.jcdglmd",
		            	id:"JCD_GLMD"
		            },{
		            	fieldLabel:"监测类别名称",
		            	name:"dcfsHjjcdJbxx.jclbmc",
		            	id:"JCLB_MC"
		            },{
		            	fieldLabel:"经度",
		            	name:"dcfsHjjcdJbxx.jkxtzbjd",
		            	id:"JKXT_ZB_JD"
		            }]
				},{
					layout:"form",
		            bodyStyle:'padding:5px 5px 0px 5px',
		            defaultType:"textfield",
		            defaults:{anchor:'97%',border:false},
		            items:[{
		            	xtype:"hidden",
	                    name:"dcfsHjjcdJbxx.jkxtmn",
	                    id: "JKXT_MN"
		            },{
                   	   xtype:"combo",
	               	   fieldLabel: "行政区划",
					   name:"dcfsHjjcdJbxx.hjzljkxzqh",
					   id: "HJZL_JK_XZQH",
					   editable: false,
	   					 triggerAction: 'all',
	   					 store: new Ext.data.SimpleStore({
	                     fields:[{name:"HJZL_JK_XZQH"},{name:"HJZL_JK_XZQH"}],
	                          data: [
	                            ['江岸区',"江岸区"],
			                   	['桥口区',"桥口区"],
			                    ['汉阳区',"汉阳区"],
			                    ['武昌区',"武昌区"],
			                    ['洪山区',"洪山区"],
			                    ['青山区',"青山区"],
			                    ['东西湖区',"东西湖区"],
			                    ['水果湖区',"水果湖区"],
			                    ['江夏区',"江夏区"],
			                    ['蔡甸区',"蔡甸区"],
			                    ['江汉区',"江汉区"],
			                    ['汉南区',"汉南区"],
			                    ['黄陂区',"黄陂区"],
			                    ['新洲区',"新洲区"],
			                    ['东湖高新区', "东湖高新区"],
					    		['武汉经济开发区',"武汉经济开发区"]
				              ]
	                    }),
	                    mode:'local',
	                    valueField:'HJZL_JK_XZQH',
	                    displayField:'HJZL_JK_XZQH',
	                    selectOnFocus:true
		            },{
		            	fieldLabel:"电场强度E",
		            	name:"dcfsHjjcdJbxx.jcddcqd",
		            	id:"JCD_DCQD"
		            },{
		            	fieldLabel:"垂直距离(m)",
		            	name:"dcfsHjjcdJbxx.jcdxdjlcz",
		            	id:"JCD_XDJL_CZ"
		            },{
		            	fieldLabel:"联系电话",
		            	name:"dcfsHjjcdJbxx.hjzljklxdh",
		            	id:"HJZL_JK_LXDH"
		            },{
		            	fieldLabel:"地址",
		            	name:"dcfsHjjcdJbxx.hjzljkdz",
		            	id:"HJZL_JK_DZ"
		            },{
		            	fieldLabel:"纬度",
		            	name:"dcfsHjjcdJbxx.jkxtzbwd",
		            	id:"JKXT_ZB_WD"
		            },{
		            	xtype:"hidden",
		            	id:"JZ_SB_BH2",
		            	name:"dcfsHjjcdJbxx.jzsbbh"
		            },{
		            	xtype:"hidden",
		            	id:"JCD_BM2",
		            	name:"dcfsHjjcdJbxx.jcdbm"
		            }]
				}]
		},{
		xtype:"textarea",
	        name:"dcfsHjjcdJbxx.hjzlbz",
	        anchor:"97%",
	        id:"HJZL_BZ",
	        fieldLabel:"&nbsp;备注",
		tabIndex:20,
	        height:60
		}],
		buttons:[
			{
				text:"添加",
				id:"submit_button",
				handler:function(){
					if(Ext.getCmp("win_jcd").action=="add"){
						Ext.getCmp("JZ_SB_BH2").setValue(Ext.getCmp("JZ_SB_BH").getValue());
						Ext.getCmp("JCD_BM2").setValue(Ext.getCmp("JCD_BM").getValue()+"_"+Ext.getCmp("JZ_SB_BH").getValue());
						Ext.getCmp("JKXT_MN").setValue(Ext.getCmp("JCD_BM").getValue()+"_"+Ext.getCmp("JZ_SB_BH").getValue());
						Ext.getCmp("jcd_form").getForm().submit({
							waitMsg : '正在提交表单数据,请稍候...',
							waitTitle : '正在验证数据...',
							method:"POST",
							url:"${webctx}/jcd_insertDcfsHjjcdJbxx.action",
							params:{action:"1"},
							success:function(form,Retaction){
								Ext.Msg.hide();
								Ext.getCmp("jcd_grid").getStore().load({
									params:{'dcfsHjjcdJbxx.jzsbbh':Ext.getCmp("JZ_SB_BH").getValue()}
								});
								Ext.getCmp("jcd_form").getForm().reset();
							},
							failure:function(form,Retaction){
								Ext.Msg.alert("提示","操作出现了异常！");
							}
						});
					}
					if(Ext.getCmp("win_jcd").action=="update"){
						Ext.getCmp("jcd_form").getForm().submit({
							waitMsg : '正在提交表单数据,请稍候...',
							waitTitle : '正在验证数据...',
							mothod:"POST",
							url:"${webctx}/jcd_updateDcfsHjjcdJbxx.action",
							params:{action:"2"},
							success:function(form,Retaction){
								Ext.Msg.hide();
								Ext.getCmp("jcd_grid").getStore().load({
									params:{'dcfsHjjcdJbxx.jzsbbh':Ext.getCmp("JZ_SB_BH").getValue()}
								});
								Ext.getCmp("win_jcd").hide();
								Ext.getCmp("jcd_form").getForm().reset();
							},
							failure:function(form,Retaction){
								Ext.Msg.alert("提示","操作出现了异常！");
							}
						});
					}
				}
			},{
				text:"取消",
				handler:function(){
					Ext.getCmp("jcd_form").getForm().reset();
					Ext.getCmp("win_jcd").hide();
				}
			}
		]
	}]
});

translateCallback = function (point){
        				Ext.getCmp("BD_JD").setValue(point.lng);
        				Ext.getCmp("BD_WD").setValue(point.lat);
                        if(Ext.getCmp("Win").action=="add") {
                            	 Ext.getCmp("YT_BH").setValue(Ext.getCmp("YT_MC").getValue());
                                Ext.getCmp("jzsbForm").getForm().submit({
                                	waitMsg : '正在提交表单数据,请稍候...',
            						waitTitle : '正在验证数据...',
                                   method:"POST",
                                   url:"${webctx }/jzsb_insertDcfsJzSbJbxx.action",
                                   params:{},
                                   success:function(form,Retaction){
                                	   Ext.Msg.hide();
	                                    Ext.getCmp("jzsb_grid").getStore().load({params:{start:0,limit:30}});
	                                   Ext.getCmp("jzsbForm").getForm().reset();
                                   },
                                   failure:function(form,Retaction){
                                        Ext.Msg.alert("提示","操作出现了异常!");
                                   }
                                });
                                
                           }
                         if(Ext.getCmp("Win").action=="update")
                           {
                                 Ext.getCmp("jzsbForm").getForm().submit({
                                	 waitMsg : '正在提交表单数据,请稍候...',
             						waitTitle : '正在验证数据...',
                                    method:"POST",
                                    url:"${webctx}/jzsb_updateDcfsJzSbJbxxByCond.action",
                                    params:{},
                                    success:function(form,Retaction){
                                    	Ext.Msg.hide();
                                        Ext.getCmp("jzsb_grid").getStore().load({params:{start:0,limit:30}});
                                        Ext.getCmp("Win").hide();
                                        Ext.getCmp("jzsbForm").getForm().reset();
                                    },
                                    failure:function(form,Retaction){
                                    	Ext.Msg.alert("提示","操作出现了异常！");
                                    }
                                });
                           }
}
//添加
var win=new Ext.Window({
    id: "Win",
    title: '添加新设备',
    closable:true,
    layout:'fit',
    oper:'add',
    closeAction:'hide',
    resizable:false,
    autoDestroy:true,
    modal:true,
    width:900,
    height:530,
    action:'add',
    items:[
    	{
    		xtype:"form",
            id:"jzsbForm",
            layout:"form",
            border:false,
            defaults:{border:false,labelWidth:100},
            items:jbxxItems,
            buttons:[
                {
                    text:"添加",
                    id:"submit_btn",
                    handler:function(){
                        if(Ext.getCmp("jzsbForm").getForm().isValid() == true){
                        	var point = new BMap.Point(Ext.getCmp("JZ_FSTX_JD").getValue(),Ext.getCmp("JZ_FSTX_WD").getValue());
                        	translateCallback(point);
                       }
                     }
                },{
                	text:"添加投诉记录",
                	handler:function(){
	            		TSJL_JBXX_Win.show();
	            	}
                },{
                       text:"取消",
                       handler:function(){
                            Ext.getCmp("Win").hide();
                            Ext.getCmp("jzsbForm").getForm().reset();
                        }
                }
            ]
    	}
    ],
   
    listeners:{
    	'hide':function(){     
    		Ext.getCmp("jzsbForm").getForm().reset();
    	},
    	'afterrender':function(){
    	    Ext.getCmp("YT_MC").getStore().load({callback:function(){
    	    	Ext.getCmp("JZ_FSTX_LX").getStore().load({
    	    		callback:function(){
    	    			Ext.getCmp("JZ_FSTX_JHFS").getStore().load();
    	    		}
    	    	});
    	    }});
    	}
    }
});

Ext.onReady(function () {
    var viewport = new MyViewport();
    viewport.render();
});

</script>
</head>
<body id="dom">

</body>
</html>